<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page language="java" import="com.server.web.JsVersionUtil"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8" />
<title>受训机构表单</title>
<script type="text/javascript"
	src='<c:url value="/js/boot.js"></c:url>?v=<%=JsVersionUtil.CURRENT_VERSION%>'></script>
<script src='<c:url value="/js/rqfui/rqfui.js"></c:url>?v=<%=JsVersionUtil.CURRENT_VERSION%>'></script>
<link rel="stylesheet" type="text/css"
	href='<c:url value="/share/styles.css"></c:url>?v=<%=JsVersionUtil.CURRENT_VERSION%>' />
<style type="text/css">
body {
	height: 100%;
}

.fieldTitle {
	width: 80px !important;
}

.mini-tabs-leftButton, .mini-tabs-rightButton {
	display: none;
}

.mini-tabs-scrollCt {
	border-top: 0;
}

.mini-tabs-bodys {
	padding: 0;
}
.headerpan{
	margin-left: 10px;
	font-size: 14px;
	font-weight:bold;
}
</style>
<script type="text/javascript">
	var sexData = [ {'text':'男'},{'text':'女'}];
</script>
</head>
<body>
	<form id="dataForm">
		<div class="formContent">
			<table class="formContentTable">
				<tr>
					<th class="fieldTitle"></th>
					<th class="fieldContent"></th>
					<th class="fieldTitle"></th>
					<th class="fieldContent"></th>
				</tr>
				<tr>
					<td class="fieldTitle">机构名称</td>
					<td class="fieldContent" colspan="3"><input id="name"
						required="true" name="name" class="mini-textbox"
						style="width: 100%;"/></td>
				</tr>
				<tr>
					<td class="fieldTitle">地址</td>
					<td class="fieldContent" colspan="3"><input id="address"
						required="true" name="address" class="mini-textbox"
						style="width: 100%;"/></td>
				</tr>
				<tr>
					<td class="fieldTitle">法人代码</td>
					<td class="fieldContent"><input id="legalCode"
						required="true" name="legalCode" class="mini-textbox"
						style="width: 100%;"/></td>
					<td class="fieldTitle">法人名称</td>
					<td class="fieldContent"><input id="legalPerson"
						required="true" name="legalPerson" class="mini-textbox"
						style="width: 100%;"/></td>
				</tr>
				<tr>
					<td class="fieldTitle">企业类型</td>
					<td class="fieldContent"><input id="type"
						required="true" name="type" class="mini-textbox"
						style="width: 100%;"/></td>
					<td class="fieldTitle">主营收入</td>
					<td class="fieldContent"><input id="income"
						required="false" name="income" class="mini-textbox"
						style="width: 100%;"/></td>
				</tr>
				<tr>
					<td class="fieldTitle">主营业务</td>
					<td class="fieldContent"><input id="business"
						required="true" name="business" class="mini-textbox"
						style="width: 100%;"/></td>
					<td class="fieldTitle">员工数量</td>
					<td class="fieldContent"><input id="staffCount"
						required="true" name="staffCount" class="mini-textbox"
						style="width: 100%;"/></td>
				</tr>
				<tr>
					<td class="fieldTitle">联系人姓名</td>
					<td class="fieldContent"><input id="linkman"
						required="true" name="linkman" class="mini-textbox"
						style="width: 100%;"/></td>
					<td class="fieldTitle">部门</td>
					<td class="fieldContent"><input id="department"
						required="false" name="department" class="mini-textbox"
						style="width: 100%;"/></td>
				</tr>
				<tr>
					<td class="fieldTitle">职务</td>
					<td class="fieldContent"><input id="duty"
						required="false" name="duty" class="mini-textbox"
						style="width: 100%;"/></td>
					<td class="fieldTitle">联系电话</td>
					<td class="fieldContent"><input id="phoneNo"
						required="true" name="phoneNo" class="mini-textbox"
						style="width: 100%;"/></td>
				</tr>
			</table>
		</div>
	</form>

	<script type="text/javascript">
		var rootPath = parent.getRootPath();
		var userName = parent.getUserName();
		var action = parent.getAction();
		var id = parent.getId();
		var type = parent.getType();
		var dataOri = null;

		mini.parse();
		mini_debugger = false;
		if(action=="check"){
			$("#password").hide();
		}
		if(action=="edit"){
			$("#ps").attr("required","false");
		}
		if(type && type!="4"){
			if(parent.hideAtt){
				parent.hideAtt();
			}
		}
		var form = new mini.Form("dataForm");
		
		SetFormData();
		
		function SetFormData() {
			if(action == "new"){
				var o = new Object();
				o.creater = userName;
				o.createTime = new Date();
				form.setData(o);
				dataOri = o;
				return;
			}
			var messageid = mini.loading("获取中...", "Loading");
			var urlBase = '<c:url value="/trainOrg/form/"></c:url>'+ id;
			$.ajax({
				url : urlBase,
				type : "get",
				dataType : 'json',
				success : function(text) {
					if (!text) {
						return;
					}
					var o = mini.decode(text);
					var amount = o.Amount;
					if(action=="edit"){
						o.password = "";
						//$("#ps").attr("required","false");
					}
					form.setData(o);
					dataOri = o;
					parent.labelModel(form);
				},
				complete : function(XMLHttpRequest, textStatus) {
					mini.hideMessageBox(messageid);
				},
				error : function(XMLHttpRequest, textStatus, errorThrown) {

				}
			});
		}
		function packData() {
			return form;
		}

		/* SetFormData();
		loadList();
		loadAttachment();
		parent.hideAttchPan(); */


		function loadList() {
			if (version == null || version == "") {
				parent.mini.alert("无法获得数据版本!");
				return;
			}
			var url = '<c:url value="/wsData/ws000011/list/string/"></c:url>'
					+ refNo + "/" + version;
			grid1.load(url);
			grid1.load({}, function() {
				parent.contentFormOnload();
			});
		}
		function onDrawGroup(e) {    
			var groupId = e.group.id;
        	var str = "版本：" + e.value;
        	if(groupId == 'g1'){
        		str += '（当前最新版本）';
        	}
        	e.cellHtml = str;
        }
	</script>
</body>
</html>